package gridy.node;

import gridy.client.Client;
import gridy.master.Master;

import org.apache.tuscany.sca.node.SCAClient;
import org.apache.tuscany.sca.node.SCANode;
import org.apache.tuscany.sca.node.launcher.NodeLauncher;
import org.osoa.sca.ServiceRuntimeException;

public class LaunchMaster {
    public static void main(String[] args) throws Exception {
        
        NodeLauncher.main(new String[] {"http://localhost:9990/node-config/NodeMaster"});

        /*
        SCANode node = null;
        try {
            
            NodeLauncher nodeLauncher = NodeLauncher.newInstance();
            node = nodeLauncher.createNodeFromURL("http://localhost:9990/node-config/NodeMaster");

            node.start();
            
            // get a reference to the calculator component
            SCAClient client = (SCAClient)node;
            Master myClient = 
                client.getService(Master.class, "MasterComponent");
            
            myClient.run();
            while(true) {
                Thread.sleep(1000);
            }
            
            //node.stop();
            
        } catch (Exception e) {
            throw new ServiceRuntimeException(e);
        }
        */
    }
}
